<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
</head>
<body>
    <script src="./001.js"></script>
    <script>
        //##原型继承 -- 并没有用圣杯模式实现继承
        // Array.prototype.__proto__.a=1
        // console.log(Array.prototype.__proto__)
        // console.log(Object.prototype)
        // console.log(Array.prototype)


        //1. 数组降维--利用字符串
        let arr = [[222,333,444],[555,666,777]]
        console.log(stringReduce(arr));


        //2. 数组降维--利用递归
        console.log(reduceDimensior(arr))


        //3. 数组降维--利用栈
        console.log(flatten(arr))


        //4. 利用数组高级函数reduce
        console.log(flattenDeep(arr))

        //5. 利用ES6的flat函数
        console.log(arr.flat())
    </script>
</body>
</html>